const state = {
  main: 0,
  height: 0,
  width: 0,
  subject: 0,
  hasAddDevice: 0,
  dongleNum: 0
};

const mutations = {
  DECREMENT_MAIN_COUNTER (state) {
    state.main--
  },
  INCREMENT_MAIN_COUNTER (state) {
    state.main++
  },
  UPD_HEIGHT (state, val) {
    state.height = val
  },
  UPD_DONGLE_NUM (state, val) {
    state.dongleNum = val
  },
  UPD_HAS_ADD_DEVICE (state, val) {
    state.hasAddDevice = val
  },
  UPD_WIDTH (state, val) {
    state.width = val
  },
  UPD_SUBJECT (state, data) {
    state.subject = data
  }
};

const actions = {
  someAsyncTask ({ commit }) {
    // do something async

    console.info(' actions invoke ')
    commit('INCREMENT_MAIN_COUNTER')
    return 0
  }
};

export default {
  state,
  mutations,
  actions
}
